const mongoose = require('../connect');

const moment = require('moment');

const notes = new mongoose.Schema({
    title:{
        type:String,
        require:true
    },
    content:{
        type:String,
        require:true
    },
    author:{
        type:String,
        require:false
    },
    time:{
        type:Date,
        require:true,
        default:()=>moment().format('YYYY-MM-DD HH:mm:ss')
    },
})

const noteModel = mongoose.model('notes',notes)

module.exports = noteModel;
